From f9587ebf91e260d72680a4948ca360e0f692129b Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 19 Oct 2006 14:59:13 +0000 Subject: [PATCH] Trivial leak test in xcsv fixed. --- gpsbabel/xcsv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpsbabel/xcsv.c b/gpsbabel/xcsv.c index b6a9d0220..6c246c4c5 100644 --- a/gpsbabel/xcsv.c +++ b/gpsbabel/xcsv.c @@ -219,7 +219,9 @@ xcsv_parse_style_line(const char *sbuff) /* field delimiters are always bad characters */ if (0 == strcmp(p, "\\w")) { - xstrappend(xcsv_file.badchars, " \n\r"); + char *s = xstrappend(xcsv_file.badchars, " \n\r"); + if (xcsv_file.badchars) xfree(xcsv_file.badchars); + xcsv_file.badchars = s; } else { xcsv_file.badchars = xstrappend(xcsv_file.badchars, p); } -- 2.30.2